﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DAO;

namespace EngineeringMaster.Administrator
{
    public partial class AdminHome : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void DeleteCourseByID(object sender, EventArgs e)
        {
            Button btn = (Button)sender;
            string courseId = btn.CommandArgument.ToString();
            CourseDAO courseDao = new CourseDAO();
            if (!courseDao.deleteByID(courseId))
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "偶偶", "<script>alert('删除失败。')</script>");
            }
            else
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('删除成功。')</script>");
                this.Repeater1.DataBind();
            }
        }
    }
}
